<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title>demo 2-19</title>
	</head>
	<body>
	</body>
	<script>
		//用法1
		let{age,name} = {name:"jack",age:20};
		console.log(name,age);
		//用法2
		let width = 600;
		let height = 800;
		let depth;
		console.log(width,height);
		let size = {
			width: 200,
			height:300,
		};
		({width,height} = size);
		console.log(width,height);
		({width,height,depth} = size);
		console.log(width,height,depth);
		({width,height,depth = 400} = size);
		console.log(width,height,depth);
		let personName,name1,age1;
		({name1:personName,age1} = {name1:"tom",age1:20});
		console.log(personName,name1,age1);
		
	</script>
</html>